﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

using System.Data.SqlClient;
namespace MasApp.DAL
{
    public class Check
    {
        public Check()
        {
            //
            //TODO: 在此处添加构造函数逻辑
            //
        }
        public static bool CheckPassword(string username,string password)
        {
            SqlCommand cmd = MasApp.DbUtil.Db.conn();
            string str = "select count(*) from login where username = '" + username + "' and password = '" + password + "'";
            cmd.CommandText = str;
            cmd.Connection.Open();
            int i = int.Parse(cmd.ExecuteScalar().ToString());
            cmd.Connection.Close();
            return i > 0 ? true : false;
        }
    }
}